<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%
	String path = request.getContextPath() + "/";
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path;
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath%>">
<meta charset="UTF-8">
<title>读者中心</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/common.css">
<script src="js/jquery-1.9.1.js"></script>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/reveal.css">
<script src="js/layer/layer.js"></script>
<script src="js/page.js"></script>
</head>
<body>
	<!--主体-->
	<div class="main ">
		<jsp:include page="head.jsp"></jsp:include>
		<div class="tableMain">
			<div class="table-responsive">
				<table class="table table-striped table-hover table-bordered">
					<thead>
						<tr>
							<th>设备</th>
							<th>刷卡时间</th>
						</tr>
					</thead>
					<tbody id="list">
					</tbody>
				</table>
			</div>
			<!--播放 视频
			<div id="myModal" class="reveal-modal">
				<a class="close-reveal-modal">&#215;</a>
			</div>
			播放 视频结束-->

			<!--分页-->
			<div class="tcdPageCode">
				
			</div>
		</div>
		<!--表格结束-->
	</div>
	<div class="footer">信昇达朗读亭</div>
	<script>
$(document).ready(function() {
	searchList(1);
});
function searchList(pageNo){
	$("#pageNo").val(pageNo);
		$.ajax({
			async : false,
			cache : false,
			type : 'post',
			dataType : "json",
			data : {'pageNo':pageNo,'pageSize':5},
			url : 'usercenter/scard_list' ,// 请求的action路径
			error : function(XMLHttpRequest, textStatus, errorThrown) {
				layer.msg("请求失败！");
			},
			success : function(data) {
				if(data.state=="9003"){
					layer.msg("没有权限！");
					return ;
				}else if(data.state=="9002"){
					layer.msg("请重新登录！");
					top.location.reload();
					return ;
				}
					var list = data.list;
					var strHtml = "";
					for(var i=0;i<list.length;i++){
						strHtml +='<tr><td>'+list[i].dname+'</td>'+
							'<td>'+list[i].sdate+'</td></tr>';
					}
					if(list.length==0){
						strHtml = "<tr style=\"text-align:center;\"><td colspan=\"2\">找不到刷卡记录！</td></tr>";
					}
					$("#list").html(strHtml);
					$(".tcdPageCode").html(pageInfo(data.totalPage,data.pageNumber));
			}
		});	
}
	</script>
</body>
</html>